#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Last modified: 

""" 模块名
@version: 0.1
@author: ChiBin <ggyqfc@gmail.com>
@license: LGPL
@see:

"""
from django.contrib import admin
from mytest.books.models import Publisher,Author,Book

class AuthorAdmin(admin.ModelAdmin):
    list_display = ('first_name','last_name','email')
    search_fields = ('first_name','last_name')

class BookAdmin(admin.ModelAdmin):
    list_display = ('title','publisher','publication_date')
    list_filter = ('publication_date',)
    #search_fields = ('title')
    date_hierarchy = 'publication_date'
    ordering = ('-publication_date',)
    filter_horizontal = ('author',)
    raw_id_fields = ('publisher',)

admin.site.register(Publisher)
admin.site.register(Author,AuthorAdmin)
admin.site.register(Book,BookAdmin)
